AppBoxoWebAppInit
An event to notify host app about miniapp’s initialization
AppBoxoWebAppGetInitData
Gets init data from host app
Returns an object with:
app_id
Miniapp ID client_id
Host client ID payload
String consisting of encrypted user details data {[key: string]: any}
null custom data passed from Hostapp token
optional User session token if it is still active.getInitData()
that handles saving details above in cookies or localStorage and returns a Promise. AppBoxoWebAppOpenMiniApp
Opens other miniapp based on provided application ID
Parameters
app_id
required Miniapp ID to openAppBoxoWebAppCloseMiniApp
Close current active miniapp
AppBoxoWebAppOnRestore
Event that is fired when miniapp is restored.
Example:
AppBoxoWebAppLogin
Login user using credentials given from host app
Example:
AppBoxoWebAppLogout
Logout and clear session token
Example:
AppBoxoWebAppClearToken
Clears saved token in host app
AppBoxoWebAppSaveToken
Saves provided token in host app
Parameters
token
required Token to save in host appAppBoxoWebAppPay
Send payment event to host app
transactionToken:string, amount: number, orderId: string, currency: string, extraParams?: any
Parameters
transactionToken
required string
Transaction tokenminiappOrderId
required number
Unique identifier for the current paymentamount
required boolean
Payment amountcurrency
required string
Define currency codeextraParams
: any
Any extra dataExample:
To receive the result of the payment event, just subscribe to the same event. Host app will sending these as the response:
Parameters
transactionToken
: string
Transaction tokenminiappOrderId
: number
Unique identifier for the current paymenthostappOrderId
: number
Unique identifier from hostappamount
: boolean
Payment amountcurrency
: string
Define currency codestatus
: string
Status of the paymentextraParams
: any
Any extra dataExample:
AppBoxoWebAppSetTabBar
Initialized native tab bar component
Parameters
show
required boolean
Defines TabBar visibilityactiveTab
required number
Active TabBar item idlist
required Array<{ tabId: number, tabName: string, tabIcon: string }> Define tabs
options
required { color: string, background: string, selectedColor: string, hasBorder: boolean, borderColor: string }
Tab bar optionsbadges
optional Array<{ tabId: number, background: string, color: string, value?: string }>
Define tab item badges.Example:
Sending event with only required changes will preserve initial options:
AppBoxoWebAppTabBarItemClick
Event that should be subscribed to in order to get active tab item click
Example:
AppBoxoWebAppSetNavigationBar
Activates native navigation bar.
Example:
Sending event with only required changes will preserve initial options:
AppBoxoWebAppSetActionButton
Changes actions button theme. By default it is dark.
Example:
AppBoxoWebAppLoadingIndicator
Show native loading indicator.
Important: Loading indicator will timeout after 30 seconds with prompt to hide it if no event is dispatched to change it.
Example:
AppBoxoWebAppOpenQRCodeReader
Opens native QR code reader.
This method will prompt a permission request for camera.
Example:
Results from QR code reader are received by events: AppBoxoWebAppOpenQRCodeReaderResult
or AppBoxoWebAppOpenQRCodeReaderFailed
Example:
AppBoxoWebAppVibrate
Triggers haptic engine on the device, if available.
Parameters
style
optional 'light' | 'medium' | 'heavy'
Controls strength of vibration, defaults to ‘light’.
Example:AppBoxoWebAppShowActionSheet
Shows native action sheet
Parameters
header
optional string
Action sheet header text
list
required Array<{ id: number, text: string, role?: 'cancel' | 'destructive' | 'selected' }>
Define action sheet items
Example:
AppBoxoWebAppActionSheetItemClick
Event that should be subscribed to in order to get action sheet item click
Example:
AppBoxoWebAppGetGeodata
Requests user geodata.
This method will prompt a permission request to access geolocation.
Example:
AppBoxoWebAppChooseLocation
Open full screen map to choose location
This method will prompt a permission request to access geolocation.
Example:
AppBoxoWebAppOpenLocation
Open full screen map to that shows markered location
This method will prompt a permission request to access geolocation.
Example:
AppBoxoWebAppShowAlert
Show native alert box
Parameters
header
optional string
Alert header text
message
optional string
Alert message
buttons
required Array<{ id: number, text: string, role?: 'cancel' | 'destructive' }>
Define buttons
Example:
AppBoxoWebAppShowImages
Open full screen native image gallery
Parameters
start_index
optional number
Index to start showing from
images
required Array<string>
Image urls
Example:
After image gallery is closed, same event will be dispatched back to miniapp with result data.
Example:
AppBoxoWebAppStorageGet
Requests a value from the storage
Parameters
keys
required Array<string>
Keys for getting ([a-zA-Z_-0-9])
Example:
AppBoxoWebAppStorageGetKeys
Request list of keys of some stored values
Parameters
count
required number
Count of keys to get. Max value is 1000
offset
optional number
The offset required to fetch a specific subset of keys. Default: 0
Example:
AppBoxoWebAppStorageSet
Stores value in storage
Parameters
key
required string
The key of value ([a-zA-Z_-0-9])
value
optional string
value
Example:
AppBoxoWebAppStorageRemove
Removes value in storage
Parameters
key
required string
The key of value ([a-zA-Z_-0-9])
Example:
AppBoxoWebAppStorageClear
Clears all data in storage
Example:
AppBoxoWebAppGetClipboard
Gets the content on the system clipboard.
Example:
AppBoxoWebAppSetClipboard
Sets the content on the system clipboard.
Parameters
data
required string
Content to be copied to clipboard
Example:
AppBoxoWebAppGetSystemInfo
Gets system information.
Example:
AppBoxoWebAppStartAccelerometer
Starts listening on acceleration data.
Example:
AppBoxoWebAppStopAccelerometer
Stops listening on acceleration data.
Example:
AppBoxoWebAppOnAccelerometerChange
Listens on the acceleration data event. You can send AppBoxoWebAppStopAccelerometer event to stop listening.
Example:
AppBoxoWebAppStartGyroscope
Starts listening on gyroscope data.
Example:
AppBoxoWebAppStopGyroscope
Stops listening on gyroscope data.
Example:
AppBoxoWebAppOnGyroscopeChange
Listens on the gyroscope data event. You can send AppBoxoWebAppStopGyroscope event to stop listening.
Example:
AppBoxoWebAppStartCompass
Starts listening on compass data.
Example:
AppBoxoWebAppStopCompass
Stops listening on compass data.
Example:
AppBoxoWebAppOnCompassChange
Listens on the compass data event. You can send AppBoxoWebAppStopCompass event to stop listening.
Example:
AppBoxoWebAppSetBackgroundColor
Dynamically sets the background color of the window.
AppBoxoWebAppSetStatusBarColor
Dynamically sets the status bar color
AppBoxoWebAppTrack
Send postback tracking data about transaction
Example:
AppBoxoWebAppCustomEvent
Send custom event to host app.
Example:
AppBoxoWebAppDownloadFile
Send event to download file
Example:
AppBoxoWebAppShare
Send event to open native share modal
Example:
AppBoxoWebAppInit
An event to notify host app about miniapp’s initialization
AppBoxoWebAppGetInitData
Gets init data from host app
Returns an object with:
app_id
Miniapp ID client_id
Host client ID payload
String consisting of encrypted user details data {[key: string]: any}
null custom data passed from Hostapp token
optional User session token if it is still active.getInitData()
that handles saving details above in cookies or localStorage and returns a Promise. AppBoxoWebAppOpenMiniApp
Opens other miniapp based on provided application ID
Parameters
app_id
required Miniapp ID to openAppBoxoWebAppCloseMiniApp
Close current active miniapp
AppBoxoWebAppOnRestore
Event that is fired when miniapp is restored.
Example:
AppBoxoWebAppLogin
Login user using credentials given from host app
Example:
AppBoxoWebAppLogout
Logout and clear session token
Example:
AppBoxoWebAppClearToken
Clears saved token in host app
AppBoxoWebAppSaveToken
Saves provided token in host app
Parameters
token
required Token to save in host appAppBoxoWebAppPay
Send payment event to host app
transactionToken:string, amount: number, orderId: string, currency: string, extraParams?: any
Parameters
transactionToken
required string
Transaction tokenminiappOrderId
required number
Unique identifier for the current paymentamount
required boolean
Payment amountcurrency
required string
Define currency codeextraParams
: any
Any extra dataExample:
To receive the result of the payment event, just subscribe to the same event. Host app will sending these as the response:
Parameters
transactionToken
: string
Transaction tokenminiappOrderId
: number
Unique identifier for the current paymenthostappOrderId
: number
Unique identifier from hostappamount
: boolean
Payment amountcurrency
: string
Define currency codestatus
: string
Status of the paymentextraParams
: any
Any extra dataExample:
AppBoxoWebAppSetTabBar
Initialized native tab bar component
Parameters
show
required boolean
Defines TabBar visibilityactiveTab
required number
Active TabBar item idlist
required Array<{ tabId: number, tabName: string, tabIcon: string }> Define tabs
options
required { color: string, background: string, selectedColor: string, hasBorder: boolean, borderColor: string }
Tab bar optionsbadges
optional Array<{ tabId: number, background: string, color: string, value?: string }>
Define tab item badges.Example:
Sending event with only required changes will preserve initial options:
AppBoxoWebAppTabBarItemClick
Event that should be subscribed to in order to get active tab item click
Example:
AppBoxoWebAppSetNavigationBar
Activates native navigation bar.
Example:
Sending event with only required changes will preserve initial options:
AppBoxoWebAppSetActionButton
Changes actions button theme. By default it is dark.
Example:
AppBoxoWebAppLoadingIndicator
Show native loading indicator.
Important: Loading indicator will timeout after 30 seconds with prompt to hide it if no event is dispatched to change it.
Example:
AppBoxoWebAppOpenQRCodeReader
Opens native QR code reader.
This method will prompt a permission request for camera.
Example:
Results from QR code reader are received by events: AppBoxoWebAppOpenQRCodeReaderResult
or AppBoxoWebAppOpenQRCodeReaderFailed
Example:
AppBoxoWebAppVibrate
Triggers haptic engine on the device, if available.
Parameters
style
optional 'light' | 'medium' | 'heavy'
Controls strength of vibration, defaults to ‘light’.
Example:AppBoxoWebAppShowActionSheet
Shows native action sheet
Parameters
header
optional string
Action sheet header text
list
required Array<{ id: number, text: string, role?: 'cancel' | 'destructive' | 'selected' }>
Define action sheet items
Example:
AppBoxoWebAppActionSheetItemClick
Event that should be subscribed to in order to get action sheet item click
Example:
AppBoxoWebAppGetGeodata
Requests user geodata.
This method will prompt a permission request to access geolocation.
Example:
AppBoxoWebAppChooseLocation
Open full screen map to choose location
This method will prompt a permission request to access geolocation.
Example:
AppBoxoWebAppOpenLocation
Open full screen map to that shows markered location
This method will prompt a permission request to access geolocation.
Example:
AppBoxoWebAppShowAlert
Show native alert box
Parameters
header
optional string
Alert header text
message
optional string
Alert message
buttons
required Array<{ id: number, text: string, role?: 'cancel' | 'destructive' }>
Define buttons
Example:
AppBoxoWebAppShowImages
Open full screen native image gallery
Parameters
start_index
optional number
Index to start showing from
images
required Array<string>
Image urls
Example:
After image gallery is closed, same event will be dispatched back to miniapp with result data.
Example:
AppBoxoWebAppStorageGet
Requests a value from the storage
Parameters
keys
required Array<string>
Keys for getting ([a-zA-Z_-0-9])
Example:
AppBoxoWebAppStorageGetKeys
Request list of keys of some stored values
Parameters
count
required number
Count of keys to get. Max value is 1000
offset
optional number
The offset required to fetch a specific subset of keys. Default: 0
Example:
AppBoxoWebAppStorageSet
Stores value in storage
Parameters
key
required string
The key of value ([a-zA-Z_-0-9])
value
optional string
value
Example:
AppBoxoWebAppStorageRemove
Removes value in storage
Parameters
key
required string
The key of value ([a-zA-Z_-0-9])
Example:
AppBoxoWebAppStorageClear
Clears all data in storage
Example:
AppBoxoWebAppGetClipboard
Gets the content on the system clipboard.
Example:
AppBoxoWebAppSetClipboard
Sets the content on the system clipboard.
Parameters
data
required string
Content to be copied to clipboard
Example:
AppBoxoWebAppGetSystemInfo
Gets system information.
Example:
AppBoxoWebAppStartAccelerometer
Starts listening on acceleration data.
Example:
AppBoxoWebAppStopAccelerometer
Stops listening on acceleration data.
Example:
AppBoxoWebAppOnAccelerometerChange
Listens on the acceleration data event. You can send AppBoxoWebAppStopAccelerometer event to stop listening.
Example:
AppBoxoWebAppStartGyroscope
Starts listening on gyroscope data.
Example:
AppBoxoWebAppStopGyroscope
Stops listening on gyroscope data.
Example:
AppBoxoWebAppOnGyroscopeChange
Listens on the gyroscope data event. You can send AppBoxoWebAppStopGyroscope event to stop listening.
Example:
AppBoxoWebAppStartCompass
Starts listening on compass data.
Example:
AppBoxoWebAppStopCompass
Stops listening on compass data.
Example:
AppBoxoWebAppOnCompassChange
Listens on the compass data event. You can send AppBoxoWebAppStopCompass event to stop listening.
Example:
AppBoxoWebAppSetBackgroundColor
Dynamically sets the background color of the window.
AppBoxoWebAppSetStatusBarColor
Dynamically sets the status bar color
AppBoxoWebAppTrack
Send postback tracking data about transaction
Example:
AppBoxoWebAppCustomEvent
Send custom event to host app.
Example:
AppBoxoWebAppDownloadFile
Send event to download file
Example:
AppBoxoWebAppShare
Send event to open native share modal
Example: